package com.zl.smartmall.library.po;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 发票信息
 * @author 陈希然
 *
 */
public class InvoiceInfo {

	private int invoiceType;
	private String invoiceHead;
	private String invoiceTypeName;

	public int getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(int invoiceType) {
		this.invoiceType = invoiceType;
	}

	public String getInvoiceHead() {
		return invoiceHead;
	}

	public void setInvoiceHead(String invoiceName) {
		this.invoiceHead = invoiceName;
	}

	public String getInvoiceTypeName() {
		return invoiceTypeName;
	}

	public void setInvoiceTypeName(String invoiceTypeName) {
		this.invoiceTypeName = invoiceTypeName;
	}
	
	public static InvoiceInfo parse(JSONObject jsonObject) throws JSONException {
		if(jsonObject != null && jsonObject.length() > 0) {
			InvoiceInfo invoice = new InvoiceInfo();
			invoice.invoiceHead = jsonObject.getString("invoice_name");
			invoice.invoiceTypeName = jsonObject.getString("invoice_type");
			return invoice;
			
		}else {
			return null;
		}
	}
}
